import React from 'react';
import { StyleSheet } from 'react-native';

import { sizes, colors } from '../../constants/theme';
import Block from './Block';


export default function Card({
  color, style, children, ...props
}) {
  const cardStyles = [
    styles.card,
    style
  ];
  return (
    <Block color={color || colors.white} style={cardStyles} {...props}>
      {children}
    </Block>
  );
}


const styles = StyleSheet.create({
  card: {
    borderRadius: sizes.radius,
    padding: sizes.base + 4,
    marginBottom: sizes.base,
  },
});
